package com.giraffe.mqtt.listener;

import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

/**
 * @Author ldx
 * @Date 2024/01/21 23:42
 **/
@Slf4j
@Component
public class MqttTopicListener {

    /**
     * 消息消费者
     *
     * @param consumerRecord 消息记录
     */
    @KafkaListener(topics = {"mqtt_data_topic"},groupId="giraffe_mqtt_group")
    public void consumer(ConsumerRecord<?, ?> consumerRecord) {
        log.info("收到bigData推送的数据'{}'", consumerRecord.toString());
    }


}
